<template>
	<view class="store_list_com">
		<u-gap height="8"></u-gap>
		<view class="body">
			<view class="title">
				<view class="title_left">
					<text class="main">{{$t('locales.bandZone')}}</text>
					<text class="minor"></text>
				</view>
				<view class="title_right">
					<text></text>
					<!-- <u-icon name="arrow-right" color="#777" size="20"></u-icon> -->
				</view>
			</view>
			<view class="contes">
				<u-grid :col="num === 1 ? 3 : 5" :border="false">
					<template v-if="num === 1">
						<u-grid-item v-for="item in value" :key="item.id" @click="itemTo(item)">
							<view class="store__container">
								<u-image
									mode="aspectFit"
									width="156rpx"
									height="104rpx"
									:src="item.logoUrl"
								></u-image>
							</view>
							<view class="grid-text u-line-1">{{ item.storeName }}</view>
						</u-grid-item>
					</template>
					
					<template v-else>
						<u-grid-item v-for="item in value" :key="item.id" @click="itemTo(item)">
							<view class="store__container-1">
								<u-image
									mode="aspectFit"
									width="108rpx"
									height="72rpx"
									:src="item.logoUrl"
								></u-image>
							</view>
							<view class="grid-text u-line-1">{{ item.storeName }}</view>
						</u-grid-item>
					</template>
				</u-grid>
			</view>
		</view>
		<u-gap height="8"></u-gap>
	</view>
</template>

<script>
export default {
	props: {
		value: {
			type: Array,
			default: () => []
		},
		
		num: {
			type: [String, Number],
			default: 1
		}
	},
	data() {
		return {}
	},
	
	methods: {
		itemTo(row) {
			uni.navigateTo({
				url: '/pages/index/store/index?domainPrefix=' + row.domainPrefix
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.store_list_com {
	margin: 0 24rpx;
	.body {
		background-color: #fff;
		border-radius: 16rpx;
		.title {
			padding: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.main {
				font-size: 32rpx;
			}
			.minor {
				font-size: 26rpx;
				color: #de3d2b;
				display: inline-block;
				margin-left: 15rpx;
			}
			.title_right {
				font-size: 24rpx;
				color: #777;
			}
		}
		.contes {
			padding: 20rpx;
			padding-top: 0;
			.grid-text {
				width: 120rpx;
				text-align: center;
				margin-top: 16rpx;
			}
		}
	}
}

.store__container {
	width: 180rpx;
	height: 124rpx;
	padding: 10rpx 12rpx;
}

.store__container-1 {
	width: 116rpx;
	height: 80rpx;
	padding: 4px;
}
</style>
